#ifndef __HR_TIME_H
#define __HR_TIME_H

#ifdef WIN32
#include <windows.h>

typedef struct {
    LARGE_INTEGER start;
    LARGE_INTEGER stop;
} stopWatch;

class CStopWatch {

private:
    stopWatch timer;
    LARGE_INTEGER frequency;
    double LIToSecs( LARGE_INTEGER & L);
public:
    CStopWatch();
    void startTimer( );
    void stopTimer( );
    double getElapsedTime();
};

#else
#include <sys/time.h>

typedef struct {
    timeval start;
    timeval stop;
} stopWatch;

class CStopWatch {

private:
    stopWatch timer;
public:
    CStopWatch() {};
    void startTimer( );
    void stopTimer( );
    double getElapsedTime();
};

#endif

#endif
